
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>男装专区</title>
    <link rel="stylesheet" type="text/css" href="/css/stroe/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="/css/stroe/loading.css"/>
    <link rel="stylesheet" type="text/css" href="/css/stroe/base.css"/>
    <link rel="stylesheet" type="text/css" href="/css/stroe/style.css"/>
    <script src="/js/jquery/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script type="text/javascript">
        $(window).load(function(){
            $(".loading").addClass("loader-chanage");
            $(".loading").fadeOut(300)

        });
        window.addEventListener('pageshow', function (e) {
            if (e.persisted) {
                window.location.reload()
            }
        });
        $(function () {
            var users = sessionStorage.getItem("user");
            var user = JSON.parse(users);
            $.get("/buys/"+user.id+"/address",function (data) {
                $("#save").renderValues(data)
            });
            $("#save").ajaxForm(function (data) {
                if(data.success){
                    window.location.href = "javascript:self.location=document.referrer;";
                }else {
                    $(document).dialog({
                        autoClose: 2500,
                        content: data.msg
                    });
                }
            })

        })
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<header class="top-header fixed-header">
    <a class="icona" href="javascript:history.go(-1)">
        <img src="/img/store/left.png"/>
    </a>
    <h3>男装专区</h3>

    <a class="text-top" >
    </a>
</header>

<div class="contaniner fixed-conta">
    <form action="/buys" method="post" class="change-address" id="save">
        <input type="hidden" name="user.id" render-value="user.id">
        <input type="hidden" name="id" render-value="id">
        <ul>
            <li>
                <label class="addd">收货人：</label>
                <input type="text" name="name" required="required" render-value="name"/>
            </li>
            <li>
                <label class="addd">手机号：</label>
                <input type="tel" name="tel" required="required" render-value="tel"/>
            </li>
            <li>
                <label class="addd">所在地区：</label>
                <select>
                    <option>安徽省</option>
                    <option>安徽省</option>
                    <option>安徽省</option>
                </select>
                <select>
                    <option>合肥市</option>
                    <option>安庆市</option>
                    <option>上海市</option>
                </select>
                <select>
                    <option>高新区</option>
                    <option>蜀山区</option>
                    <option>庐阳区</option>
                </select>
            </li>
            <li>
                <label class="addd">详细地址：</label>
                <textarea required="required" name="site" render-html="site"></textarea>
            </li>
        </ul>

        <ul>
            <li class="checkboxa">
                <input type="checkbox" id="check"/>
                <label class="check" for="check" onselectstart="return false"  >设置为默认地址</label>
            </li>
        </ul>
        <ul>
            <li>
                <h3>删除此地址</h3>
            </li>
        </ul>
        <button type="submit"  id="saveBtn">保存</button>
    </form>
</div>

<script type="text/javascript">
    $(".checkboxa label").on('touchstart',function(){
        if($(this).hasClass('checkd')){
            $(".checkboxa label").removeClass("checkd");
        }else{
            $(".checkboxa label").addClass("checkd");
        }
    })
</script>
</body>
</html>